wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/aria2.sh && chmod +x aria2.sh && bash aria2.sh

wget -N --no-check-certificate https://www.moerats.com/usr/shell/Caddy/caddy_install.sh && chmod +x caddy_install.sh && bash caddy_install.sh

mkdir /usr/local/caddy/www && mkdir /usr/local/caddy/www/aria2

echo "http://www.btseed.cn {
  root /usr/local/caddy/www/aria2
 browse /Download
  timeouts none
  gzip
}" > /usr/local/caddy/Caddyfile

apt-get install unzip -y

mkdir /usr/local/caddy/www/aria2/Download && cd /usr/local/caddy/www/aria2

Ver=$(wget --no-check-certificate -qO- https://api.github.com/repos/mayswind/AriaNg/releases/latest | grep -o '"tag_name": ".*"' | sed 's/"//g;s/tag_name: //g') && echo ${Ver}

wget -N --no-check-certificate "https://github.com/mayswind/AriaNg/releases/download/${Ver}/AriaNg-${Ver}.zip" && unzip AriaNg-${Ver}.zip && rm -rf AriaNg-${Ver}.zip

chmod -R 755 /usr/local/caddy/www/aria2

/etc/init.d/caddy start

wget https://www.moerats.com/usr/shell/rclone_debian.sh && bash rclone_debian.sh

rclone config

chmod 777 /root/.aria2/autoupload.sh

/etc/init.d/caddy restart